﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>张家港殡葬信息化骨灰跟踪管理平台</title>
    <link rel="shortcut icon" type="image/ico" href="images/favicon.ico" />
    <link rel="stylesheet" type="text/css" href="themes/default/easyui.css"  />
    <link rel="stylesheet" type="text/css" href="themes/icon.css"  />
    <link rel="stylesheet" type="text/css" href="css/table.css"  />
    <link rel="Stylesheet" type="text/css" href="css/autoSearchText.css"  />
    <script type="text/javascript" src="js/jquery.min.js" ></script>
    <script type="text/javascript" src="js/jquery.easyui.min.js" ></script>
    <script type="text/javascript" src="js/common.js" ></script>
    <script type="text/javascript" src="js/init.js" ></script>
    <script type="text/javascript" src="js/easyui-lang-zh_CN.js" ></script>
    <script type="text/javascript" src="js/jquery.form.js" ></script>
    <script type="text/javascript" src="js/jquery.autocomplete.min.js" ></script>
    <script type="text/javascript" src="js/datagrid-detailview.js"></script>
    <script type="text/javascript" src="js/jquery.autoSearchText.js"></script>   
</head>
<body class="easyui-layout" >
    <div data-options="region:'north',border:false" style="height: 60px; background: url(images/logo.png) no-repeat #B3DFDA; padding: 10px; font-size: 24px">
        <div style="position: absolute; right: 5px; top: 10px;"  id="div_welcome"></div>
        <div style="position: absolute; right: 0px; bottom: 0px;">
            <a href="javascript:void(0);" class="easyui-linkbutton"
                data-options="plain:true,iconCls:'icon-boss'" onclick="searchMyInfo();">我的信息</a>
            <a href="javascript:void(0);" class="easyui-linkbutton"
                data-options="plain:true,iconCls:'icon-set'" onclick="changePwd();">修改密码</a>
            <a href="javascript:void(0);" class="easyui-linkbutton"
                data-options="plain:true,iconCls:'icon-stop'" onclick="loginOut();">退出系统</a>
        </div>
    </div>
    <div data-options="region:'west',split:true,title:'功能导航'" style="width: 180px; padding: 10px;">
        <div>
            <ul id="treeLeft"></ul>
        </div>
    </div>
    <div data-options="region:'center'">
        <div id="tabs" class="easyui-tabs" data-options="
                    border:false,
                    fit:true,
                    tools:[
                    {iconCls : 'icon-reload',text:'刷新',handler:refreshTab},
                    {iconCls : 'icon-delete3',text:'关闭全部',handler:closeTab}
                    ]">
           <div title="未存死者" iconCls="icon-unstore" data-options="">
            <script type="text/javascript">
                $(function () {
                    getButton("dead_unstore");  //请求当前用户可以操作的按钮        
                });

                function ui_dead_unstore_init_list(toolbar) {                    
                    $("#ui_dead_unstore_dg").datagrid({       //初始化datagrid
                        url: "ashx/bg_dead.ashx?action=search",
                        striped: true, rownumbers: true, pagination: true, pageSize: 20, singleSelect: false,
                        idField: 'id',
                        sortName: 'actFiretime',
                        sortOrder: 'asc',
                        pageList: [20, 40, 60, 80, 100],
                        frozenColumns: [[
                            { field: 'name', title: '姓名', width: 100 }

                        ]],
                        queryParams: {
                            where: ' (starttime is null)  '
                        },
                        columns: [[
                                    { field: 'gender', title: '性别', width: 40 },
                                    { field: 'cardno', title: '身份证', width: 150 },
                                    { field: 'actFiretime', title: '火化时间', sortable: true, width: 150 },
                                    { field: 'estStoretime', title: '预存日期', sortable: true, width: 150 },
                                    {
                                        field: 'days', title: '相隔天数', width: 80, sortable: true,
                                        formatter: function (value, row, index) {
                                            return value && value.length > 20 ? '<span title="' + value + '">' + value + '</span>' : value;
                                        }
                                    },
                                    {
                                        field: 'estStoreplace', title: '预存骨灰堂', sortable: true, width: 160,
                                        formatter: function (value, row, index) {
                                            return value && value.length > 20 ? '<span title="' + value + '">' + value + '</span>' : value;
                                        }
                                    },
                                    { field: 'areaName', title: '村（镇）', width: 100 },
                                    { field: 'relativeName', title: '联系姓名', width: 100 },
                                    { field: 'relativeTel', title: '联系电话', width: 100 },
                                    { field: 'relationId', title: '与死者关系', width: 100 },
                                    {
                                        field: 'homeAddress', title: '地址', width: 250,
                                        formatter: function (value, row, index) {
                                            return value && value.length > 20 ? '<span title="' + value + '">' + value + '</span>' : value;
                                        }
                                    }
                        ]],
                        rowStyler: function (index, row) {
                            if (row.days >= 30) {
                                return 'color:#CC6699;font-weight:bold;';
                            } else if (row.days >= 15) {
                                return 'color:#FF0033;';
                            } else if (row.days >= 7) {
                                return 'color:#333399;';
                            }

                        },
                        toolbar: toolbar.length == 0 ? null : toolbar   //请求回来的当前用户可以操作的按钮            
                    });
                }

                function ui_dead_unstore_searchdata() {
                    var whereStr = "1=1";
                    var days = $('#ui_dead_unstore_search').find('[name=ui_dead_unstore_search_days]').val();
                    var areaid = $('#ui_dead_unstore_search_area').combotree('getValue');
                    var starttime = $('#ui_dead_unstore_search').find('[name=ui_dead_unstore_search_dead_datestart]').val();
                    var endtime = $('#ui_dead_unstore_search').find('[name=ui_dead_unstore_search_dead_dateend]').val();
                    var bStore = $('#ui_dead_unstore_search').find('[name=ui_dead_unstore_search_store]').val();
                    if (days != "") {
                        whereStr += " and DATEDIFF(day, actFiretime, getdate())>=" + days;
                    }

                    if (areaid != "") {
                        var aid = areaid.substr(9, 3);
                        if (aid == "000") {
                            whereStr += " and left(areacode,9)='" + areaid.substr(0, 9) + "'";
                        } else {
                            whereStr += " and areacode='" + areaid + "'";
                        }
                    }
                    if (starttime != "") {
                        whereStr += " and actFiretime >= '" + starttime + "'";
                    }
                    if (endtime != "") {
                        whereStr += " and actFiretime <= '" + endtime + "'";
                    }
                    if (bStore == "Y") {
                        whereStr += " and (graveid >= 0 and starttime  is not null )";
                    } else {
                        whereStr += " and (starttime is null)";
                    }

                    $("#ui_dead_unstore_dg").datagrid('load', { where: whereStr });
                    $("#ui_dead_unstore_dg").datagrid('clearSelections').datagrid('clearChecked');
                    //$('#ui_dead_unstore_layout').layout('collapse', 'east');    //隐藏
                }
                function ui_dead_unstore_cleardata() {
                    $('#ui_dead_unstore_search input').val('');
                    $('#ui_dead_unstore_search select').val('select');
                    $('#ui_dead_unstore_search_dead_datestart').datebox('setValue', '');
                    $('#ui_dead_unstore_search_dead_dateend').datebox('setValue', '');
                    $("#ui_dead_unstore_dg").datagrid('load', { where: ' (starttime is null) ' });

                    $("#ui_dead_unstore_dg").datagrid('clearSelections').datagrid('clearChecked');
                    //$('#ui_dead_unstore_layout').layout('collapse', 'east');    //隐藏
                }
            </script>
            <div id="ui_dead_unstore_layout"  class="easyui-layout" data-options="fit:true,border:false">
                <div data-options="region:'center',border:false">
                    <table id="ui_dead_unstore_dg" data-options="fit:true,border:false">
                    </table>
                </div>
                <div id="unstore_mm" data-options="region:'west',split:true,border:true,collapsed:true" title="多条件查询"
                    style="width: 280px;">
                    <div id="ui_dead_unstore_search">
                        <table class="tableForm" style="width: 100%; height: 100%; background: #F5F5F5;">
                
                            <tr>
                                <th>未存天数：
                                </th>
                                <td>
                                    <input class="easyui-numberbox" name="ui_dead_unstore_search_days" id="ui_dead_unstore_search_days" autocomplete="off" style="width: 130px;" />
                                </td>
                            </tr> 
                            <tr>
                                <th>是否入葬：
                                </th>
                                <td>
                                    <select class="easyui-combobox"  name="ui_dead_unstore_search_store" id="ui_dead_unstore_search_store" data-options="panelHeight:65,editable:false">                                                                    
                                        <option value="N">否</option>  
                                        <option value="Y">是</option>                          
                                    </select>
                                </td>
                            </tr>                
                            <tr>
                                <th>所属地区：
                                </th>
                                <td>                        
                                    <input class="easyui-combotree" id="ui_dead_unstore_search_area" name="ui_dead_unstore_search_area"
                                        data-options="url:'ashx/bg_area.ashx?action=getall', lines:true" />
                                </td>
                            </tr>
                            <tr>
                                <th>火化日期：
                                </th>
                                <td>
                                    <input name="ui_dead_unstore_search_dead_datestart" id="ui_dead_unstore_search_dead_datestart" class="easyui-datebox"
                                        editable="false" style="width: 140px;" />
                                </td>
                            </tr>
                            <tr>
                                <th>至：
                                </th>
                                <td>
                                    <input name="ui_dead_unstore_search_dead_dateend" id="ui_dead_unstore_search_dead_dateend" class="easyui-datebox"
                                        editable="false" style="width: 140px;" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-search" plain="true"
                                        onclick="ui_dead_unstore_searchdata();">搜索</a>
                                </td>
                                <td>
                                    <a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-clear" plain="true"
                                        onclick="ui_dead_unstore_cleardata();">清空条件</a>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>

           </div>
        </div>        
    </div>
    <div data-options="region:'south'"><div style="float:right;font-size:8pt">开发单位： 长沙民政职业技术学院软件学院(2015)&nbsp;&nbsp;</div></div>
</body>
</html>
